<?php
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
 *                                   ATTENTION!
 * If you see this message in browser (Internet Explorer, Mozilla firefox, etc.)
 * this means that
 *
 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
 */


    require_once 'components/utils/check_utils.php';
    CheckPHPVersion();



    require_once 'database_engine/mysql_engine.php';
    require_once 'components/page.php';
    require_once 'phpgen_settings.php';
    require_once 'authorization.php';

    function GetConnectionOptions()
    {
        $result = GetGlobalConnectionOptions();
        $result['client_encoding'] = 'utf8';
        GetApplication()->GetUserAuthorizationStrategy()->ApplyIdentityToConnectionOptions($result);
        return $result;
    }

    
    ?><?php
    
    ?><?php
    
    class maklumat_stafPage extends Page
    {
        protected function DoBeforeCreate()
        {
            $this->dataset = new TableDataset(
                new MySqlIConnectionFactory(),
                GetConnectionOptions(),
                '`maklumat_staf`');
            $field = new IntegerField('id', null, null, true);
            if (!$this->GetSecurityInfo()->AdminGrant())
              $field->SetReadOnly(true, GetApplication()->GetCurrentUserId());
            $this->dataset->AddField($field, true);
            $field = new StringField('nama');
            $this->dataset->AddField($field, false);
            $field = new IntegerField('noic');
            $this->dataset->AddField($field, false);
            $field = new StringField('gred');
            $this->dataset->AddField($field, false);
            $field = new StringField('jawatan');
            $this->dataset->AddField($field, false);
            $field = new StringField('nama_jabatan');
            $this->dataset->AddField($field, false);
            $field = new StringField('cawangan');
            $this->dataset->AddField($field, false);
            $field = new StringField('nama_kursus');
            $this->dataset->AddField($field, false);
            $field = new StringField('tempat_kursus');
            $this->dataset->AddField($field, false);
            $field = new StringField('anjuran');
            $this->dataset->AddField($field, false);
            $field = new DateField('tarikh_mula');
            $this->dataset->AddField($field, false);
            $field = new DateField('tarikh_tamat');
            $this->dataset->AddField($field, false);
            $field = new IntegerField('bil_hari');
            $this->dataset->AddField($field, false);
        }
    
        protected function CreatePageNavigator()
        {
            $result = new CompositePageNavigator($this);
            
            $partitionNavigator = new PageNavigator('pnav', $this, $this->dataset);
            $partitionNavigator->SetRowsPerPage(30);
            $result->AddPageNavigator($partitionNavigator);
            
            return $result;
        }
    
        public function GetPageList()
        {
            $currentPageCaption = $this->GetShortCaption();
            $result = new PageList();
            if (GetCurrentUserGrantForDataSource('maklumat_staf')->HasViewGrant())
                $result->AddPage(new PageLink($this->RenderText('Maklumat Staf'), 'maklumat_staf.php', $this->RenderText('Maklumat Staf'), $currentPageCaption == $this->RenderText('Maklumat Staf')));
            if (GetCurrentUserGrantForDataSource('permohonan_kursus')->HasViewGrant())
                $result->AddPage(new PageLink($this->RenderText('Rekod Kehadiran'), 'permohonan_kursus.php', $this->RenderText('Rekod Kehadiran'), $currentPageCaption == $this->RenderText('Rekod Kehadiran')));
            if (GetCurrentUserGrantForDataSource('maklumat_kursus')->HasViewGrant())
                $result->AddPage(new PageLink($this->RenderText('Training Road Map'), 'maklumat_kursus.php', $this->RenderText('Training Road Map'), $currentPageCaption == $this->RenderText('Training Road Map')));
            
            if ( HasAdminPage() && GetApplication()->HasAdminGrantForCurrentUser() )
              $result->AddPage(new PageLink($this->RenderText('Admin page'), 'phpgen_admin.php', 'Admin page', false, true));
            return $result;
        }
    
        protected function CreateRssGenerator()
        {
            return null;
        }
    
        protected function CreateGridSearchControl($grid)
        {
            $grid->UseFilter = true;
            $grid->SearchControl = new SimpleSearch('maklumat_stafssearch', $this->dataset,
                array('nama', 'noic', 'gred', 'jawatan', 'nama_jabatan', 'cawangan', 'nama_kursus', 'tempat_kursus', 'anjuran', 'tarikh_mula', 'tarikh_tamat', 'bil_hari'),
                array($this->RenderText('Nama'), $this->RenderText('No. Kad Pengenalan'), $this->RenderText('Gred'), $this->RenderText('Jawatan'), $this->RenderText('Nama Jabatan'), $this->RenderText('Cawangan'), $this->RenderText('Nama Kursus'), $this->RenderText('Tempat Kursus'), $this->RenderText('Anjuran'), $this->RenderText('Tarikh Mula'), $this->RenderText('Tarikh Tamat'), $this->RenderText('Bil Hari')),
                array(
                    '=' => $this->GetLocalizerCaptions()->GetMessageString('equals'),
                    '<>' => $this->GetLocalizerCaptions()->GetMessageString('doesNotEquals'),
                    '<' => $this->GetLocalizerCaptions()->GetMessageString('isLessThan'),
                    '<=' => $this->GetLocalizerCaptions()->GetMessageString('isLessThanOrEqualsTo'),
                    '>' => $this->GetLocalizerCaptions()->GetMessageString('isGreaterThan'),
                    '>=' => $this->GetLocalizerCaptions()->GetMessageString('isGreaterThanOrEqualsTo'),
                    'ILIKE' => $this->GetLocalizerCaptions()->GetMessageString('Like'),
                    'STARTS' => $this->GetLocalizerCaptions()->GetMessageString('StartsWith'),
                    'ENDS' => $this->GetLocalizerCaptions()->GetMessageString('EndsWith'),
                    'CONTAINS' => $this->GetLocalizerCaptions()->GetMessageString('Contains')
                    ), $this->GetLocalizerCaptions(), $this, 'CONTAINS'
                );
        }
    
        protected function CreateGridAdvancedSearchControl($grid)
        {
            $this->AdvancedSearchControl = new AdvancedSearchControl('maklumat_stafasearch', $this->dataset, $this->GetLocalizerCaptions(), $this->GetColumnVariableContainer(), $this->CreateLinkBuilder());
            $this->AdvancedSearchControl->AddSearchColumn($this->AdvancedSearchControl->CreateStringSearchInput('nama', $this->RenderText('Nama')));
            $this->AdvancedSearchControl->AddSearchColumn($this->AdvancedSearchControl->CreateStringSearchInput('noic', $this->RenderText('No. Kad Pengenalan')));
            $this->AdvancedSearchControl->AddSearchColumn($this->AdvancedSearchControl->CreateStringSearchInput('gred', $this->RenderText('Gred')));
            $this->AdvancedSearchControl->AddSearchColumn($this->AdvancedSearchControl->CreateStringSearchInput('jawatan', $this->RenderText('Jawatan')));
            $this->AdvancedSearchControl->AddSearchColumn($this->AdvancedSearchControl->CreateStringSearchInput('nama_jabatan', $this->RenderText('Nama Jabatan')));
            $this->AdvancedSearchControl->AddSearchColumn($this->AdvancedSearchControl->CreateStringSearchInput('cawangan', $this->RenderText('Cawangan')));
            $this->AdvancedSearchControl->AddSearchColumn($this->AdvancedSearchControl->CreateStringSearchInput('nama_kursus', $this->RenderText('Nama Kursus')));
            $this->AdvancedSearchControl->AddSearchColumn($this->AdvancedSearchControl->CreateStringSearchInput('tempat_kursus', $this->RenderText('Tempat Kursus')));
            $this->AdvancedSearchControl->AddSearchColumn($this->AdvancedSearchControl->CreateStringSearchInput('anjuran', $this->RenderText('Anjuran')));
            $this->AdvancedSearchControl->AddSearchColumn($this->AdvancedSearchControl->CreateDateTimeSearchInput('tarikh_mula', $this->RenderText('Tarikh Mula')));
            $this->AdvancedSearchControl->AddSearchColumn($this->AdvancedSearchControl->CreateDateTimeSearchInput('tarikh_tamat', $this->RenderText('Tarikh Tamat')));
            $this->AdvancedSearchControl->AddSearchColumn($this->AdvancedSearchControl->CreateStringSearchInput('bil_hari', $this->RenderText('Bil Hari')));
        }
    
        protected function AddOperationsColumns($grid)
        {
            $actionsBandName = 'actions';
            $grid->AddBandToBegin($actionsBandName, $this->GetLocalizerCaptions()->GetMessageString('Actions'), true);
            if ($this->GetSecurityInfo()->HasViewGrant())
            {
                $column = $grid->AddViewColumn(new RowOperationByLinkColumn($this->GetLocalizerCaptions()->GetMessageString('View'), OPERATION_VIEW, $this->dataset), $actionsBandName);
            }
            if ($this->GetSecurityInfo()->HasEditGrant())
            {
                $column = $grid->AddViewColumn(new RowOperationByLinkColumn($this->GetLocalizerCaptions()->GetMessageString('Edit'), OPERATION_EDIT, $this->dataset), $actionsBandName);
                $column->OnShow->AddListener('ShowEditButtonHandler', $this);
            }
            if ($this->GetSecurityInfo()->HasDeleteGrant())
            {
                $column = $grid->AddViewColumn(new RowOperationByLinkColumn($this->GetLocalizerCaptions()->GetMessageString('Delete'), OPERATION_DELETE, $this->dataset), $actionsBandName);
                $column->OnShow->AddListener('ShowDeleteButtonHandler', $this);
            $column->SetAdditionalAttribute("modal-delete", "true");
            $column->SetAdditionalAttribute("delete-handler-name", $this->GetModalGridDeleteHandler());
            }
            if ($this->GetSecurityInfo()->HasAddGrant())
            {
                $column = $grid->AddViewColumn(new RowOperationByLinkColumn($this->GetLocalizerCaptions()->GetMessageString('Copy'), OPERATION_COPY, $this->dataset), $actionsBandName);
            }
        }
    
        protected function AddFieldColumns($grid)
        {
            //
            // View column for nama field
            //
            $column = new TextViewColumn('nama', 'Nama', $this->dataset);
            $column->SetOrderable(true);
            $column->SetMaxLength(75);
            $column->SetFullTextWindowHandlerName('nama_handler');
            /* <inline edit column> */
            //
            // Edit column for nama field
            //
            $editor = new TextEdit('nama_edit');
            $editColumn = new CustomEditColumn('Nama', 'nama', $editor, $this->dataset);
            $editColumn->SetReadOnly(true);
            $editColumn->SetAllowSetToNull(true);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $column->SetEditOperationColumn($editColumn);
            /* </inline edit column> */
            
            /* <inline insert column> */
            //
            // Edit column for nama field
            //
            $editor = new TextEdit('nama_edit');
            $editColumn = new CustomEditColumn('Nama', 'nama', $editor, $this->dataset);
            $editColumn->SetReadOnly(true);
            $editColumn->SetAllowSetToNull(true);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $column->SetInsertOperationColumn($editColumn);
            /* </inline insert column> */
            $column->SetDescription($this->RenderText(''));
            $column->SetFixedWidth(null);
            $grid->AddViewColumn($column);
            
            //
            // View column for noic field
            //
            $column = new TextViewColumn('noic', 'No. Kad Pengenalan', $this->dataset);
            $column->SetOrderable(true);
            
            /* <inline edit column> */
            //
            // Edit column for noic field
            //
            $editor = new TextEdit('noic_edit');
            $editColumn = new CustomEditColumn('No. Kad Pengenalan', 'noic', $editor, $this->dataset);
            $editColumn->SetReadOnly(true);
            $editColumn->SetAllowSetToNull(true);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $column->SetEditOperationColumn($editColumn);
            /* </inline edit column> */
            
            /* <inline insert column> */
            //
            // Edit column for noic field
            //
            $editor = new TextEdit('noic_edit');
            $editColumn = new CustomEditColumn('No. Kad Pengenalan', 'noic', $editor, $this->dataset);
            $editColumn->SetReadOnly(true);
            $editColumn->SetAllowSetToNull(true);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $column->SetInsertOperationColumn($editColumn);
            /* </inline insert column> */
            $column->SetDescription($this->RenderText(''));
            $column->SetFixedWidth(null);
            $grid->AddViewColumn($column);
            
            //
            // View column for gred field
            //
            $column = new TextViewColumn('gred', 'Gred', $this->dataset);
            $column->SetOrderable(true);
            $column->SetMaxLength(75);
            $column->SetFullTextWindowHandlerName('gred_handler');
            
            /* <inline edit column> */
            //
            // Edit column for gred field
            //
            $editor = new TextEdit('gred_edit');
            $editColumn = new CustomEditColumn('Gred', 'gred', $editor, $this->dataset);
            $editColumn->SetReadOnly(true);
            $editColumn->SetAllowSetToNull(true);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $column->SetEditOperationColumn($editColumn);
            /* </inline edit column> */
            
            /* <inline insert column> */
            //
            // Edit column for gred field
            //
            $editor = new TextEdit('gred_edit');
            $editColumn = new CustomEditColumn('Gred', 'gred', $editor, $this->dataset);
            $editColumn->SetReadOnly(true);
            $editColumn->SetAllowSetToNull(true);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $column->SetInsertOperationColumn($editColumn);
            /* </inline insert column> */
            $column->SetDescription($this->RenderText(''));
            $column->SetFixedWidth(null);
            $grid->AddViewColumn($column);
            
            //
            // View column for jawatan field
            //
            $column = new TextViewColumn('jawatan', 'Jawatan', $this->dataset);
            $column->SetOrderable(true);
            $column->SetMaxLength(75);
            $column->SetFullTextWindowHandlerName('jawatan_handler');
            
            /* <inline edit column> */
            //
            // Edit column for jawatan field
            //
            $editor = new TextEdit('jawatan_edit');
            $editColumn = new CustomEditColumn('Jawatan', 'jawatan', $editor, $this->dataset);
            $editColumn->SetReadOnly(true);
            $editColumn->SetAllowSetToNull(true);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $column->SetEditOperationColumn($editColumn);
            /* </inline edit column> */
            
            /* <inline insert column> */
            //
            // Edit column for jawatan field
            //
            $editor = new TextEdit('jawatan_edit');
            $editColumn = new CustomEditColumn('Jawatan', 'jawatan', $editor, $this->dataset);
            $editColumn->SetReadOnly(true);
            $editColumn->SetAllowSetToNull(true);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $column->SetInsertOperationColumn($editColumn);
            /* </inline insert column> */
            $column->SetDescription($this->RenderText(''));
            $column->SetFixedWidth(null);
            $grid->AddViewColumn($column);
            
            //
            // View column for nama_jabatan field
            //
            $column = new TextViewColumn('nama_jabatan', 'Nama Jabatan', $this->dataset);
            $column->SetOrderable(true);
            $column->SetMaxLength(75);
            $column->SetFullTextWindowHandlerName('nama_jabatan_handler');
            
            /* <inline edit column> */
            //
            // Edit column for nama_jabatan field
            //
            $editor = new TextEdit('nama_jabatan_edit');
            $editColumn = new CustomEditColumn('Nama Jabatan', 'nama_jabatan', $editor, $this->dataset);
            $editColumn->SetReadOnly(true);
            $editColumn->SetAllowSetToNull(true);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $column->SetEditOperationColumn($editColumn);
            /* </inline edit column> */
            
            /* <inline insert column> */
            //
            // Edit column for nama_jabatan field
            //
            $editor = new TextEdit('nama_jabatan_edit');
            $editColumn = new CustomEditColumn('Nama Jabatan', 'nama_jabatan', $editor, $this->dataset);
            $editColumn->SetReadOnly(true);
            $editColumn->SetAllowSetToNull(true);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $column->SetInsertOperationColumn($editColumn);
            /* </inline insert column> */
            $column->SetDescription($this->RenderText(''));
            $column->SetFixedWidth(null);
            $grid->AddViewColumn($column);
            
            //
            // View column for cawangan field
            //
            $column = new TextViewColumn('cawangan', 'Cawangan', $this->dataset);
            $column->SetOrderable(true);
            $column->SetMaxLength(75);
            $column->SetFullTextWindowHandlerName('cawangan_handler');
            
            /* <inline edit column> */
            //
            // Edit column for cawangan field
            //
            $editor = new TextEdit('cawangan_edit');
            $editColumn = new CustomEditColumn('Cawangan', 'cawangan', $editor, $this->dataset);
            $editColumn->SetReadOnly(true);
            $editColumn->SetAllowSetToNull(true);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $column->SetEditOperationColumn($editColumn);
            /* </inline edit column> */
            
            /* <inline insert column> */
            //
            // Edit column for cawangan field
            //
            $editor = new TextEdit('cawangan_edit');
            $editColumn = new CustomEditColumn('Cawangan', 'cawangan', $editor, $this->dataset);
            $editColumn->SetReadOnly(true);
            $editColumn->SetAllowSetToNull(true);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $column->SetInsertOperationColumn($editColumn);
            /* </inline insert column> */
            $column->SetDescription($this->RenderText(''));
            $column->SetFixedWidth(null);
            $grid->AddViewColumn($column);
        }
    
        protected function AddSingleRecordViewColumns($grid)
        {
            //
            // View column for nama field
            //
            $column = new TextViewColumn('nama', 'Nama', $this->dataset);
            $column->SetOrderable(true);
            $column->SetMaxLength(75);
            $column->SetFullTextWindowHandlerName('nama_handler');
            $grid->AddSingleRecordViewColumn($column);
            
            //
            // View column for noic field
            //
            $column = new TextViewColumn('noic', 'No. Kad Pengenalan', $this->dataset);
            $column->SetOrderable(true);
            $grid->AddSingleRecordViewColumn($column);
            
            //
            // View column for gred field
            //
            $column = new TextViewColumn('gred', 'Gred', $this->dataset);
            $column->SetOrderable(true);
            $column->SetMaxLength(75);
            $column->SetFullTextWindowHandlerName('gred_handler');
            $grid->AddSingleRecordViewColumn($column);
            
            //
            // View column for jawatan field
            //
            $column = new TextViewColumn('jawatan', 'Jawatan', $this->dataset);
            $column->SetOrderable(true);
            $column->SetMaxLength(75);
            $column->SetFullTextWindowHandlerName('jawatan_handler');
            $grid->AddSingleRecordViewColumn($column);
            
            //
            // View column for nama_jabatan field
            //
            $column = new TextViewColumn('nama_jabatan', 'Nama Jabatan', $this->dataset);
            $column->SetOrderable(true);
            $column->SetMaxLength(75);
            $column->SetFullTextWindowHandlerName('nama_jabatan_handler');
            $grid->AddSingleRecordViewColumn($column);
            
            //
            // View column for cawangan field
            //
            $column = new TextViewColumn('cawangan', 'Cawangan', $this->dataset);
            $column->SetOrderable(true);
            $column->SetMaxLength(75);
            $column->SetFullTextWindowHandlerName('cawangan_handler');
            $grid->AddSingleRecordViewColumn($column);
            
            //
            // View column for nama_kursus field
            //
            $column = new TextViewColumn('nama_kursus', 'Nama Kursus', $this->dataset);
            $column->SetOrderable(true);
            $column->SetMaxLength(75);
            $column->SetFullTextWindowHandlerName('nama_kursus_handler');
            $grid->AddSingleRecordViewColumn($column);
            
            //
            // View column for tempat_kursus field
            //
            $column = new TextViewColumn('tempat_kursus', 'Tempat Kursus', $this->dataset);
            $column->SetOrderable(true);
            $column->SetMaxLength(75);
            $column->SetFullTextWindowHandlerName('tempat_kursus_handler');
            $grid->AddSingleRecordViewColumn($column);
            
            //
            // View column for anjuran field
            //
            $column = new TextViewColumn('anjuran', 'Anjuran', $this->dataset);
            $column->SetOrderable(true);
            $column->SetMaxLength(75);
            $column->SetFullTextWindowHandlerName('anjuran_handler');
            $grid->AddSingleRecordViewColumn($column);
            
            //
            // View column for tarikh_mula field
            //
            $column = new DateTimeViewColumn('tarikh_mula', 'Tarikh Mula', $this->dataset);
            $column->SetDateTimeFormat('Y-m-d');
            $column->SetOrderable(true);
            $grid->AddSingleRecordViewColumn($column);
            
            //
            // View column for tarikh_tamat field
            //
            $column = new DateTimeViewColumn('tarikh_tamat', 'Tarikh Tamat', $this->dataset);
            $column->SetDateTimeFormat('Y-m-d');
            $column->SetOrderable(true);
            $grid->AddSingleRecordViewColumn($column);
            
            //
            // View column for bil_hari field
            //
            $column = new TextViewColumn('bil_hari', 'Bil Hari', $this->dataset);
            $column->SetOrderable(true);
            $grid->AddSingleRecordViewColumn($column);
        }
    
        protected function AddEditColumns($grid)
        {
            //
            // Edit column for nama field
            //
            $editor = new TextEdit('nama_edit');
            $editColumn = new CustomEditColumn('Nama', 'nama', $editor, $this->dataset);
            $editColumn->SetReadOnly(true);
            $editColumn->SetAllowSetToNull(true);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $grid->AddEditColumn($editColumn);
            
            //
            // Edit column for noic field
            //
            $editor = new TextEdit('noic_edit');
            $editColumn = new CustomEditColumn('Noic', 'noic', $editor, $this->dataset);
            $editColumn->SetReadOnly(true);
            $editColumn->SetAllowSetToNull(true);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $grid->AddEditColumn($editColumn);
            
            //
            // Edit column for gred field
            //
            $editor = new TextEdit('gred_edit');
            $editColumn = new CustomEditColumn('Gred', 'gred', $editor, $this->dataset);
            $editColumn->SetReadOnly(true);
            $editColumn->SetAllowSetToNull(true);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $grid->AddEditColumn($editColumn);
            
            //
            // Edit column for jawatan field
            //
            $editor = new TextEdit('jawatan_edit');
            $editColumn = new CustomEditColumn('Jawatan', 'jawatan', $editor, $this->dataset);
            $editColumn->SetReadOnly(true);
            $editColumn->SetAllowSetToNull(true);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $grid->AddEditColumn($editColumn);
            
            //
            // Edit column for nama_jabatan field
            //
            $editor = new TextEdit('nama_jabatan_edit');
            $editColumn = new CustomEditColumn('Nama Jabatan', 'nama_jabatan', $editor, $this->dataset);
            $editColumn->SetReadOnly(true);
            $editColumn->SetAllowSetToNull(true);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $grid->AddEditColumn($editColumn);
            
            //
            // Edit column for cawangan field
            //
            $editor = new TextEdit('cawangan_edit');
            $editColumn = new CustomEditColumn('Cawangan', 'cawangan', $editor, $this->dataset);
            $editColumn->SetReadOnly(true);
            $editColumn->SetAllowSetToNull(true);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $grid->AddEditColumn($editColumn);
            
            //
            // Edit column for nama_kursus field
            //
            $editor = new HtmlWysiwygEditor('nama_kursus_edit');
            $editor->SetAllowColorControls(true);
            $editColumn = new CustomEditColumn('Nama Kursus', 'nama_kursus', $editor, $this->dataset);
            $editColumn->SetAllowSetToNull(true);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $grid->AddEditColumn($editColumn);
            
            //
            // Edit column for tempat_kursus field
            //
            $editor = new TextEdit('tempat_kursus_edit');
            $editColumn = new CustomEditColumn('Tempat Kursus', 'tempat_kursus', $editor, $this->dataset);
            $editColumn->SetAllowSetToNull(true);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $grid->AddEditColumn($editColumn);
            
            //
            // Edit column for anjuran field
            //
            $editor = new TextEdit('anjuran_edit');
            $editColumn = new CustomEditColumn('Anjuran', 'anjuran', $editor, $this->dataset);
            $editColumn->SetAllowSetToNull(true);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $grid->AddEditColumn($editColumn);
            
            //
            // Edit column for tarikh_mula field
            //
            $editor = new DateTimeEdit('tarikh_mula_edit', false, 'Y-m-d H:i:s', 0);
            $editColumn = new CustomEditColumn('Tarikh Mula', 'tarikh_mula', $editor, $this->dataset);
            $editColumn->SetAllowSetToNull(true);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $grid->AddEditColumn($editColumn);
            
            //
            // Edit column for tarikh_tamat field
            //
            $editor = new DateTimeEdit('tarikh_tamat_edit', true, 'd-m-Y H:i:s', 0);
            $editColumn = new CustomEditColumn('Tarikh Tamat', 'tarikh_tamat', $editor, $this->dataset);
            $editColumn->SetAllowSetToNull(true);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $grid->AddEditColumn($editColumn);
            
            //
            // Edit column for bil_hari field
            //
            $editor = new TextEdit('bil_hari_edit');
            $editColumn = new CustomEditColumn('Bil Hari', 'bil_hari', $editor, $this->dataset);
            $editColumn->SetAllowSetToNull(true);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $grid->AddEditColumn($editColumn);
        }
    
        protected function AddInsertColumns($grid)
        {
            //
            // Edit column for nama field
            //
            $editor = new TextEdit('nama_edit');
            $editColumn = new CustomEditColumn('Nama', 'nama', $editor, $this->dataset);
            $editColumn->SetReadOnly(true);
            $editColumn->SetAllowSetToNull(true);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $grid->AddInsertColumn($editColumn);
            
            //
            // Edit column for noic field
            //
            $editor = new TextEdit('noic_edit');
            $editColumn = new CustomEditColumn('No. Kad Pengenalan', 'noic', $editor, $this->dataset);
            $editColumn->SetReadOnly(true);
            $editColumn->SetAllowSetToNull(true);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $grid->AddInsertColumn($editColumn);
            
            //
            // Edit column for gred field
            //
            $editor = new TextEdit('gred_edit');
            $editColumn = new CustomEditColumn('Gred', 'gred', $editor, $this->dataset);
            $editColumn->SetReadOnly(true);
            $editColumn->SetAllowSetToNull(true);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $grid->AddInsertColumn($editColumn);
            
            //
            // Edit column for jawatan field
            //
            $editor = new TextEdit('jawatan_edit');
            $editColumn = new CustomEditColumn('Jawatan', 'jawatan', $editor, $this->dataset);
            $editColumn->SetReadOnly(true);
            $editColumn->SetAllowSetToNull(true);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $grid->AddInsertColumn($editColumn);
            
            //
            // Edit column for nama_jabatan field
            //
            $editor = new TextEdit('nama_jabatan_edit');
            $editColumn = new CustomEditColumn('Nama Jabatan', 'nama_jabatan', $editor, $this->dataset);
            $editColumn->SetReadOnly(true);
            $editColumn->SetAllowSetToNull(true);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $grid->AddInsertColumn($editColumn);
            
            //
            // Edit column for cawangan field
            //
            $editor = new TextEdit('cawangan_edit');
            $editColumn = new CustomEditColumn('Cawangan', 'cawangan', $editor, $this->dataset);
            $editColumn->SetReadOnly(true);
            $editColumn->SetAllowSetToNull(true);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $grid->AddInsertColumn($editColumn);
            
            //
            // Edit column for nama_kursus field
            //
            $editor = new HtmlWysiwygEditor('nama_kursus_edit');
            $editor->SetAllowColorControls(true);
            $editColumn = new CustomEditColumn('Nama Kursus', 'nama_kursus', $editor, $this->dataset);
            $editColumn->SetAllowSetToNull(true);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $grid->AddInsertColumn($editColumn);
            
            //
            // Edit column for tempat_kursus field
            //
            $editor = new TextEdit('tempat_kursus_edit');
            $editColumn = new CustomEditColumn('Tempat Kursus', 'tempat_kursus', $editor, $this->dataset);
            $editColumn->SetAllowSetToNull(true);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $grid->AddInsertColumn($editColumn);
            
            //
            // Edit column for anjuran field
            //
            $editor = new TextEdit('anjuran_edit');
            $editColumn = new CustomEditColumn('Anjuran', 'anjuran', $editor, $this->dataset);
            $editColumn->SetAllowSetToNull(true);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $grid->AddInsertColumn($editColumn);
            
            //
            // Edit column for tarikh_mula field
            //
            $editor = new DateTimeEdit('tarikh_mula_edit', false, 'Y-m-d H:i:s', 0);
            $editColumn = new CustomEditColumn('Tarikh Mula', 'tarikh_mula', $editor, $this->dataset);
            $editColumn->SetAllowSetToNull(true);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $grid->AddInsertColumn($editColumn);
            
            //
            // Edit column for tarikh_tamat field
            //
            $editor = new DateTimeEdit('tarikh_tamat_edit', true, 'd-m-Y H:i:s', 0);
            $editColumn = new CustomEditColumn('Tarikh Tamat', 'tarikh_tamat', $editor, $this->dataset);
            $editColumn->SetAllowSetToNull(true);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $grid->AddInsertColumn($editColumn);
            
            //
            // Edit column for bil_hari field
            //
            $editor = new TextEdit('bil_hari_edit');
            $editColumn = new CustomEditColumn('Bil Hari', 'bil_hari', $editor, $this->dataset);
            $editColumn->SetAllowSetToNull(true);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $grid->AddInsertColumn($editColumn);
            if ($this->GetSecurityInfo()->HasAddGrant())
            {
                $grid->SetShowAddButton(true);
                $grid->SetShowInlineAddButton(false);
            }
            else
            {
                $grid->SetShowInlineAddButton(false);
                $grid->SetShowAddButton(false);
            }
        }
    
        protected function AddPrintColumns($grid)
        {
            //
            // View column for nama field
            //
            $column = new TextViewColumn('nama', 'Nama', $this->dataset);
            $column->SetOrderable(true);
            $grid->AddPrintColumn($column);
            
            //
            // View column for noic field
            //
            $column = new TextViewColumn('noic', 'No. Kad Pengenalan', $this->dataset);
            $column->SetOrderable(true);
            $grid->AddPrintColumn($column);
            
            //
            // View column for gred field
            //
            $column = new TextViewColumn('gred', 'Gred', $this->dataset);
            $column->SetOrderable(true);
            $grid->AddPrintColumn($column);
            
            //
            // View column for jawatan field
            //
            $column = new TextViewColumn('jawatan', 'Jawatan', $this->dataset);
            $column->SetOrderable(true);
            $grid->AddPrintColumn($column);
            
            //
            // View column for nama_jabatan field
            //
            $column = new TextViewColumn('nama_jabatan', 'Nama Jabatan', $this->dataset);
            $column->SetOrderable(true);
            $grid->AddPrintColumn($column);
            
            //
            // View column for cawangan field
            //
            $column = new TextViewColumn('cawangan', 'Cawangan', $this->dataset);
            $column->SetOrderable(true);
            $grid->AddPrintColumn($column);
            
            //
            // View column for nama_kursus field
            //
            $column = new TextViewColumn('nama_kursus', 'Nama Kursus', $this->dataset);
            $column->SetOrderable(true);
            $grid->AddPrintColumn($column);
            
            //
            // View column for tempat_kursus field
            //
            $column = new TextViewColumn('tempat_kursus', 'Tempat Kursus', $this->dataset);
            $column->SetOrderable(true);
            $grid->AddPrintColumn($column);
            
            //
            // View column for anjuran field
            //
            $column = new TextViewColumn('anjuran', 'Anjuran', $this->dataset);
            $column->SetOrderable(true);
            $grid->AddPrintColumn($column);
            
            //
            // View column for tarikh_mula field
            //
            $column = new DateTimeViewColumn('tarikh_mula', 'Tarikh Mula', $this->dataset);
            $column->SetDateTimeFormat('Y-m-d');
            $column->SetOrderable(true);
            $grid->AddPrintColumn($column);
            
            //
            // View column for tarikh_tamat field
            //
            $column = new DateTimeViewColumn('tarikh_tamat', 'Tarikh Tamat', $this->dataset);
            $column->SetDateTimeFormat('Y-m-d');
            $column->SetOrderable(true);
            $grid->AddPrintColumn($column);
            
            //
            // View column for bil_hari field
            //
            $column = new TextViewColumn('bil_hari', 'Bil Hari', $this->dataset);
            $column->SetOrderable(true);
            $grid->AddPrintColumn($column);
        }
    
        protected function AddExportColumns($grid)
        {
            //
            // View column for nama field
            //
            $column = new TextViewColumn('nama', 'Nama', $this->dataset);
            $column->SetOrderable(true);
            $grid->AddExportColumn($column);
            
            //
            // View column for noic field
            //
            $column = new TextViewColumn('noic', 'No. Kad Pengenalan', $this->dataset);
            $column->SetOrderable(true);
            $grid->AddExportColumn($column);
            
            //
            // View column for gred field
            //
            $column = new TextViewColumn('gred', 'Gred', $this->dataset);
            $column->SetOrderable(true);
            $grid->AddExportColumn($column);
            
            //
            // View column for jawatan field
            //
            $column = new TextViewColumn('jawatan', 'Jawatan', $this->dataset);
            $column->SetOrderable(true);
            $grid->AddExportColumn($column);
            
            //
            // View column for nama_jabatan field
            //
            $column = new TextViewColumn('nama_jabatan', 'Nama Jabatan', $this->dataset);
            $column->SetOrderable(true);
            $grid->AddExportColumn($column);
            
            //
            // View column for cawangan field
            //
            $column = new TextViewColumn('cawangan', 'Cawangan', $this->dataset);
            $column->SetOrderable(true);
            $grid->AddExportColumn($column);
            
            //
            // View column for nama_kursus field
            //
            $column = new TextViewColumn('nama_kursus', 'Nama Kursus', $this->dataset);
            $column->SetOrderable(true);
            $grid->AddExportColumn($column);
            
            //
            // View column for tempat_kursus field
            //
            $column = new TextViewColumn('tempat_kursus', 'Tempat Kursus', $this->dataset);
            $column->SetOrderable(true);
            $grid->AddExportColumn($column);
            
            //
            // View column for anjuran field
            //
            $column = new TextViewColumn('anjuran', 'Anjuran', $this->dataset);
            $column->SetOrderable(true);
            $grid->AddExportColumn($column);
            
            //
            // View column for tarikh_mula field
            //
            $column = new DateTimeViewColumn('tarikh_mula', 'Tarikh Mula', $this->dataset);
            $column->SetDateTimeFormat('Y-m-d');
            $column->SetOrderable(true);
            $grid->AddExportColumn($column);
            
            //
            // View column for tarikh_tamat field
            //
            $column = new DateTimeViewColumn('tarikh_tamat', 'Tarikh Tamat', $this->dataset);
            $column->SetDateTimeFormat('Y-m-d');
            $column->SetOrderable(true);
            $grid->AddExportColumn($column);
            
            //
            // View column for bil_hari field
            //
            $column = new TextViewColumn('bil_hari', 'Bil Hari', $this->dataset);
            $column->SetOrderable(true);
            $grid->AddExportColumn($column);
        }
    
        public function GetPageDirection()
        {
            return null;
        }
    
        protected function ApplyCommonColumnEditProperties($column)
        {
            $column->SetShowSetToNullCheckBox(false);
    	$column->SetVariableContainer($this->GetColumnVariableContainer());
        }
    
        function BeforeBeginRenderPage()
        {
            if ($this->GetRecordPermission() != null)
        	       if (!$this->GetRecordPermission()->CanAllUsersViewRecords())
                     if (GetApplication()->GetCurrentUserId() == null)
                         $this->dataset->AddFieldFilter('id', new IsNullFieldFilter());
                     else{
        		             $this->dataset->AddFieldFilter('id', new FieldFilter(GetApplication()->GetCurrentUserId(), '='));
							 
							 //$gred = $this->dataset->GetFields();
							 //print($this->GetCustomClientScript());
							 //echo $this->GetStafGred();
							GetApplication()->SetSessionVariable('gred', $this->GetStafGred());
					 }
        }
		
		function GetStafGred(){
			$sql = sprintf("select gred from maklumat_staf where id = '%s'",
				GetApplication()->GetCurrentUserId());
			$con = GetGlobalConnectionOptions();
			$mysqli = new mysqli($con["server"], $con["username"], $con["password"], $con["database"]);
			if ($mysqli->connect_errno) {
				echo "Failed to connect to MySQL: (" . $mysqli->connect_errno . ") " . $mysqli->connect_error;
			}
			$row = $mysqli->query($sql);
			$result = $row->fetch_assoc();
				//var_dump($result);
			return $result['gred'];
			
		}
        
        function GetCustomClientScript()
        {
			return ;
        }
        
        function GetOnPageLoadedClientScript()
        {
            return ;
        }
        public function ShowEditButtonHandler($show)
        {
            if ($this->GetRecordPermission() != null)
                $show = $this->GetRecordPermission()->HasEditGrant($this->GetDataset());
        }
        public function ShowDeleteButtonHandler($show)
        {
            if ($this->GetRecordPermission() != null)
                $show = $this->GetRecordPermission()->HasDeleteGrant($this->GetDataset());
        }
        
        public function GetModalGridDeleteHandler() { return 'maklumat_staf_modal_delete'; }
        protected function GetEnableModalGridDelete() { return true; }
    
        protected function CreateGrid()
        {
            $result = new Grid($this, $this->dataset, 'maklumat_stafGrid');
            if ($this->GetSecurityInfo()->HasDeleteGrant())
               $result->SetAllowDeleteSelected(true);
            else
               $result->SetAllowDeleteSelected(false);   
            
            ApplyCommonPageSettings($this, $result);
            
            $result->SetUseImagesForActions(false);
            $result->SetUseFixedHeader(false);
            
            $result->SetShowLineNumbers(false);
            
            $result->SetHighlightRowAtHover(false);
            $result->SetWidth('');
            $this->CreateGridSearchControl($result);
            $this->CreateGridAdvancedSearchControl($result);
            $this->AddOperationsColumns($result);
            $this->AddFieldColumns($result);
            $this->AddSingleRecordViewColumns($result);
            $this->AddEditColumns($result);
            $this->AddInsertColumns($result);
            $this->AddPrintColumns($result);
            $this->AddExportColumns($result);
    
            $this->SetShowPageList(true);
            $this->SetExportToExcelAvailable(true);
            $this->SetExportToWordAvailable(false);
            $this->SetExportToXmlAvailable(false);
            $this->SetExportToCsvAvailable(false);
            $this->SetExportToPdfAvailable(true);
            $this->SetPrinterFriendlyAvailable(true);
            $this->SetSimpleSearchAvailable(true);
            $this->SetAdvancedSearchAvailable(true);
            $this->SetVisualEffectsEnabled(true);
            $this->SetShowTopPageNavigator(true);
            $this->SetShowBottomPageNavigator(true);
    
            //
            // Http Handlers
            //
            //
            // View column for nama field
            //
            $column = new TextViewColumn('nama', 'Nama', $this->dataset);
            $column->SetOrderable(true);
            
            /* <inline edit column> */
            //
            // Edit column for nama field
            //
            $editor = new TextEdit('nama_edit');
            $editColumn = new CustomEditColumn('Nama', 'nama', $editor, $this->dataset);
            $editColumn->SetReadOnly(true);
            $editColumn->SetAllowSetToNull(true);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $column->SetEditOperationColumn($editColumn);
            /* </inline edit column> */
            
            /* <inline insert column> */
            //
            // Edit column for nama field
            //
            $editor = new TextEdit('nama_edit');
            $editColumn = new CustomEditColumn('Nama', 'nama', $editor, $this->dataset);
            $editColumn->SetReadOnly(true);
            $editColumn->SetAllowSetToNull(true);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $column->SetInsertOperationColumn($editColumn);
            /* </inline insert column> */
            $handler = new ShowTextBlobHandler($this->dataset, $this, 'nama_handler', $column);
            GetApplication()->RegisterHTTPHandler($handler);
            //
            // View column for gred field
            //
            $column = new TextViewColumn('gred', 'Gred', $this->dataset);
            $column->SetOrderable(true);
            
            /* <inline edit column> */
            //
            // Edit column for gred field
            //
            $editor = new TextEdit('gred_edit');
            $editColumn = new CustomEditColumn('Gred', 'gred', $editor, $this->dataset);
            $editColumn->SetReadOnly(true);
            $editColumn->SetAllowSetToNull(true);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $column->SetEditOperationColumn($editColumn);
            /* </inline edit column> */
            
            /* <inline insert column> */
            //
            // Edit column for gred field
            //
            $editor = new TextEdit('gred_edit');
            $editColumn = new CustomEditColumn('Gred', 'gred', $editor, $this->dataset);
            $editColumn->SetReadOnly(true);
            $editColumn->SetAllowSetToNull(true);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $column->SetInsertOperationColumn($editColumn);
            /* </inline insert column> */
            $handler = new ShowTextBlobHandler($this->dataset, $this, 'gred_handler', $column);
            GetApplication()->RegisterHTTPHandler($handler);
            //
            // View column for jawatan field
            //
            $column = new TextViewColumn('jawatan', 'Jawatan', $this->dataset);
            $column->SetOrderable(true);
            
            /* <inline edit column> */
            //
            // Edit column for jawatan field
            //
            $editor = new TextEdit('jawatan_edit');
            $editColumn = new CustomEditColumn('Jawatan', 'jawatan', $editor, $this->dataset);
            $editColumn->SetReadOnly(true);
            $editColumn->SetAllowSetToNull(true);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $column->SetEditOperationColumn($editColumn);
            /* </inline edit column> */
            
            /* <inline insert column> */
            //
            // Edit column for jawatan field
            //
            $editor = new TextEdit('jawatan_edit');
            $editColumn = new CustomEditColumn('Jawatan', 'jawatan', $editor, $this->dataset);
            $editColumn->SetReadOnly(true);
            $editColumn->SetAllowSetToNull(true);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $column->SetInsertOperationColumn($editColumn);
            /* </inline insert column> */
            $handler = new ShowTextBlobHandler($this->dataset, $this, 'jawatan_handler', $column);
            GetApplication()->RegisterHTTPHandler($handler);
            //
            // View column for nama_jabatan field
            //
            $column = new TextViewColumn('nama_jabatan', 'Nama Jabatan', $this->dataset);
            $column->SetOrderable(true);
            
            /* <inline edit column> */
            //
            // Edit column for nama_jabatan field
            //
            $editor = new TextEdit('nama_jabatan_edit');
            $editColumn = new CustomEditColumn('Nama Jabatan', 'nama_jabatan', $editor, $this->dataset);
            $editColumn->SetReadOnly(true);
            $editColumn->SetAllowSetToNull(true);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $column->SetEditOperationColumn($editColumn);
            /* </inline edit column> */
            
            /* <inline insert column> */
            //
            // Edit column for nama_jabatan field
            //
            $editor = new TextEdit('nama_jabatan_edit');
            $editColumn = new CustomEditColumn('Nama Jabatan', 'nama_jabatan', $editor, $this->dataset);
            $editColumn->SetReadOnly(true);
            $editColumn->SetAllowSetToNull(true);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $column->SetInsertOperationColumn($editColumn);
            /* </inline insert column> */
            $handler = new ShowTextBlobHandler($this->dataset, $this, 'nama_jabatan_handler', $column);
            GetApplication()->RegisterHTTPHandler($handler);
            //
            // View column for cawangan field
            //
            $column = new TextViewColumn('cawangan', 'Cawangan', $this->dataset);
            $column->SetOrderable(true);
            
            /* <inline edit column> */
            //
            // Edit column for cawangan field
            //
            $editor = new TextEdit('cawangan_edit');
            $editColumn = new CustomEditColumn('Cawangan', 'cawangan', $editor, $this->dataset);
            $editColumn->SetReadOnly(true);
            $editColumn->SetAllowSetToNull(true);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $column->SetEditOperationColumn($editColumn);
            /* </inline edit column> */
            
            /* <inline insert column> */
            //
            // Edit column for cawangan field
            //
            $editor = new TextEdit('cawangan_edit');
            $editColumn = new CustomEditColumn('Cawangan', 'cawangan', $editor, $this->dataset);
            $editColumn->SetReadOnly(true);
            $editColumn->SetAllowSetToNull(true);
            $this->ApplyCommonColumnEditProperties($editColumn);
            $column->SetInsertOperationColumn($editColumn);
            /* </inline insert column> */
            $handler = new ShowTextBlobHandler($this->dataset, $this, 'cawangan_handler', $column);
            GetApplication()->RegisterHTTPHandler($handler);//
            // View column for nama field
            //
            $column = new TextViewColumn('nama', 'Nama', $this->dataset);
            $column->SetOrderable(true);
            $handler = new ShowTextBlobHandler($this->dataset, $this, 'nama_handler', $column);
            GetApplication()->RegisterHTTPHandler($handler);
            //
            // View column for gred field
            //
            $column = new TextViewColumn('gred', 'Gred', $this->dataset);
            $column->SetOrderable(true);
            $handler = new ShowTextBlobHandler($this->dataset, $this, 'gred_handler', $column);
            GetApplication()->RegisterHTTPHandler($handler);
            //
            // View column for jawatan field
            //
            $column = new TextViewColumn('jawatan', 'Jawatan', $this->dataset);
            $column->SetOrderable(true);
            $handler = new ShowTextBlobHandler($this->dataset, $this, 'jawatan_handler', $column);
            GetApplication()->RegisterHTTPHandler($handler);
            //
            // View column for nama_jabatan field
            //
            $column = new TextViewColumn('nama_jabatan', 'Nama Jabatan', $this->dataset);
            $column->SetOrderable(true);
            $handler = new ShowTextBlobHandler($this->dataset, $this, 'nama_jabatan_handler', $column);
            GetApplication()->RegisterHTTPHandler($handler);
            //
            // View column for cawangan field
            //
            $column = new TextViewColumn('cawangan', 'Cawangan', $this->dataset);
            $column->SetOrderable(true);
            $handler = new ShowTextBlobHandler($this->dataset, $this, 'cawangan_handler', $column);
            GetApplication()->RegisterHTTPHandler($handler);
            //
            // View column for nama_kursus field
            //
            $column = new TextViewColumn('nama_kursus', 'Nama Kursus', $this->dataset);
            $column->SetOrderable(true);
            $handler = new ShowTextBlobHandler($this->dataset, $this, 'nama_kursus_handler', $column);
            GetApplication()->RegisterHTTPHandler($handler);
            //
            // View column for tempat_kursus field
            //
            $column = new TextViewColumn('tempat_kursus', 'Tempat Kursus', $this->dataset);
            $column->SetOrderable(true);
            $handler = new ShowTextBlobHandler($this->dataset, $this, 'tempat_kursus_handler', $column);
            GetApplication()->RegisterHTTPHandler($handler);
            //
            // View column for anjuran field
            //
            $column = new TextViewColumn('anjuran', 'Anjuran', $this->dataset);
            $column->SetOrderable(true);
            $handler = new ShowTextBlobHandler($this->dataset, $this, 'anjuran_handler', $column);
            GetApplication()->RegisterHTTPHandler($handler);
            return $result;
        }
        
        protected function OpenAdvancedSearchByDefault()
        {
            return false;
        }
    
        protected function DoGetGridHeader()
        {
            return '';
        }
    }

    SetUpUserAuthorization(GetApplication());

    try
    {
        $Page = new maklumat_stafPage("maklumat_staf.php", "maklumat_staf", GetCurrentUserGrantForDataSource("maklumat_staf"), 'UTF-8');
        $Page->SetShortCaption('Maklumat Staf');
        $Page->SetHeader(GetPagesHeader());
        $Page->SetFooter(GetPagesFooter());
        $Page->SetCaption('Maklumat Staf');
        $Page->SetRecordPermission(GetCurrentUserRecordPermissionsForDataSource("maklumat_staf"));

        GetApplication()->SetMainPage($Page);
        GetApplication()->Run();
    }
    catch(Exception $e)
    {
        ShowErrorPage($e->getMessage());
    }

?>
